﻿using Enter.Admin.Models;
using Microsoft.AspNetCore.Diagnostics;
using Microsoft.AspNetCore.Mvc;

namespace Enter.Admin.Controllers
{
    public class ErrorController : Controller
    {
        [Route("Error/{statusCode}")]
        public IActionResult Index(int statusCode)
        {
            //var statusCodeResult =  HttpContext.Features.Get<IStatusCodeReExecuteFeature>();
            //switch (statusCode)
            //{
            //    case 404:
            //        ViewBag.ErrorMessage = "抱歉，读者访问的页面不存在";
            //        ViewBag.Path = statusCodeResult.OriginalPath;
            //        ViewBag.QS = statusCodeResult.OriginalQueryString;
            //        break;
            //}
            return View("Error", new ErrorViewModel() { StatusCode = statusCode });
        }
    }
}
